IF SUBSTR(textdate,7,4) ~= SUBSTR(DATE('s'),1,4) THEN DO; entrys = entrys - 1; done = 1; END
IF ~done THEN IF SUBSTR(textdate,4,2) ~= SUBSTR(DATE('s'),5,2) THEN entrys = entrys - 1
END
line = READLN(log); line = READLN(log); line = READLN(log) /* Bugfix */
logbug = 0 /* in */
IF C2X(LEFT(line,1)) ~= 20 THEN logbug = 1 /* v1.5 */
END
END
IF EOF(log) THEN LEAVE
END
CLOSE(log)
END
ELSE SAY 'Unable to open "'filename'"'
END
IF entrys = 0 THEN EXIT
IF width < 20 THEN width = 20
IF width > 40 THEN width = 40
DO n = 1 TO entrys
IF LENGTH(list.n.bbsname) > width THEN list.n.bbsname = LEFT(list.n.bbsname,20)
DO (width + 1) - LENGTH(list.n.bbsname) /* <-- bugfix in v1.2 */
list.n.bbsname = list.n.bbsname || ' '
END
END
IF entrys > 1 & s = 1 THEN DO /* Selectsort routine */
DO n = 1 TO entrys - 1
min = n
DO m = n + 1 TO entrys
IF sortmode = 1 THEN IF SUBSTR(list.m.ld,7,4)SUBSTR(list.m.ld,4,2)SUBSTR(list.m.ld,1,2)SUBSTR(list.m.ld,13,2)SUBSTR(list.m.ld,16,2)SUBSTR(list.m.ld,19,2)y < SUBSTR(list.min.ld,7,4)SUBSTR(list.min.ld,4,2)SUBSTR(list.min.ld,1,2)SUBSTR(list.min.ld,13,2)SUBSTR(list.min.ld,16,2)SUBSTR(list.min.ld,19,2)y THEN min = m
IF sortmode = 2 THEN IF SUBSTR(list.min.ld,7,4)SUBSTR(list.min.ld,4,2)SUBSTR(list.min.ld,1,2)SUBSTR(list.min.ld,13,2)SUBSTR(list.min.ld,16,2)SUBSTR(list.min.ld,19,2)y < SUBSTR(list.m.ld,7,4)SUBSTR(list.m.ld,4,2)SUBSTR(list.m.ld,1,2)SUBSTR(list.m.ld,13,2)SUBSTR(list.m.ld,16,2)SUBSTR(list.m.ld,19,2)y THEN min = m
IF sortmode = 3 THEN DO
IF UPPER(LEFT(list.m.bbsname,4)) = 'THE ' THEN; a = SUBSTR(list.m.bbsname,5,LENGTH(list.m.bbsname)-4); ELSE a = list.m.bbsname
IF UPPER(LEFT(list.min.bbsname,4)) = 'THE ' THEN; b = SUBSTR(list.min.bbsname,5,LENGTH(list.min.bbsname)-4); ELSE b = list.min.bbsname
IF UPPER(a) < UPPER(b) THEN min = m /* <-- Bugfix in v1.9 */